<template>
  <div>
    <TitleHeader :title="title"></TitleHeader>
    <div class="collection-list" v-for="item in list" :key="item.houseCode">
      <div class="left">
        <img :src="'http://liufusong.top:8080' + item.houseImg" alt="" />
      </div>
      <div class="right">
        <h3>{{ item.title }}</h3>
        <div class="desc">{{ item.desc }}</div>
        <span class="tag" v-for="item in item.tags" :key="item">{{
          item
        }}</span>
        <div class="price">
          <span class="num">{{ item.price }}</span
          >&nbsp;元/月
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import request from "@/utils/request";
export default {
  name: "collection-page",
  components: {},
  props: {},
  data() {
    return {
      title: "收藏列表",
      list: [],
    };
  },
  computed: {},
  watch: {},
  async created() {
    const data = await request({ url: "/user/favorites" });
    console.log(data);
    this.list = data.body;
  },
  methods: {},
};
</script>

<style scoped lang="less">
.collection-list {
  height: 100px;
  width: 100%;
  padding-top: 18px;
  // background-color: #ccc;
  display: flex;
  border-bottom: 1px solid #ddd;
  img {
    width: 106px;
    height: 80px;
  }
  .right {
    padding-left: 12px;
    h3 {
      margin: 0;
      font-size: 15px;
      height: 22px;
      color: #394043;
      line-height: 22px;
    }
    .desc {
      font-size: 12px;
      color: #afb2b3;
      height: 22px;
      line-height: 20px;
    }
    .tag {
      display: block;
      width: 36px;
      height: 20px;
      padding: 0px 5px;
      background-color: #e1f5f8;
      color: #39bfcd;
      font-size: 12px;
      margin-right: 5px;
      line-height: 20px;
      border-radius: 3px;
    }
    .price {
      height: 23px;
      line-height: 23px;
      font-size: 12px;
      color: #fa5741;
      .num {
        font-size: 16px;
        font-weight: 700;
      }
    }
  }
}
</style>
